      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          <ol class="breadcrumb">
            <li><a href="<?=site_url()?>/user/index">新品管理</a></li>
            <li class="active">新品列表</li>
          </ol>
          <div class="row">
            <div class="col-md-12">
             <!-- <div class="btn-group pull-right" id="templatemo_sort_btn">
                <button type="button" class="btn btn-default">Sort by</button>
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                  <span class="caret"></span>
                  <span class="sr-only">Toggle Dropdown</span>
                </button>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="#">First Name</a></li>
                  <li><a href="#">Last Name</a></li>
                  <li><a href="#">Username</a></li>
                </ul>
             </div>-->
              
              <div class="table-responsive">
                <h4 class="margin-bottom-15">新品列表</h4>
                <table class="table table-striped table-hover table-bordered">
                  <thead>
                    <tr>
                      <th>ID</th>
                      <th>新品名称</th>
                      <th>新品描述</th>
                      <th>预约数量</th>
                      <th>提交用户</th>
                      <th>饭店名称</th>
                      <th>提交时间</th>
                      <th>回复</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                  	<?php foreach ($newproducts as $item):?>
                    <tr>
                      <td><?php echo $item['id'];?></td>
                      <td><?php echo $item['name'];?></td>
                      <td><?php echo $item['description'];?></td>
                      <td><?php echo $item['amount'];?></td>
                      <td><?php echo $item['contact'];?></td>
                      <td><?php echo $item['shopname'];?></td>
                      <td><?php echo $item['submit_time'];?></td>
                      <td><?php echo $item['reply'];?></td>
                      <td>
                      		<a href="<?php echo site_url('newproduct/reply/id/'.$item['id'])?>" class="btn btn-default">回复</a>
                      		<button class="message" data-id="<?php echo $item['userid'];?>" >短信提醒</button>
                      </td>
                    </tr>
                     <?php endforeach;?>
                  </tbody>
                </table>
              
              </div>
               <?php  echo $links; ?>
              <!--<ul class="pagination pull-right">
                <li class="disabled"><a href="#">&laquo;</a></li>
                <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">2 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">3 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">4 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">5 <span class="sr-only">(current)</span></a></li>
                <li><a href="#">&raquo;</a></li>
              </ul>  -->
            </div>
          </div>
        </div>
      </div>
      <script>
	$(document).ready(function() {
		$(".message").click(function() {
			var userid = $(this).attr("data-id");
			$.ajax({
				url : '<?php echo site_url('newproduct/sendmessage')?>',
				type : "post",
				async : true,
				data : {
					'userid' : userid
				},
				dataType : "json",
				success : function(data) {
					if(data.code)
					{
						alert(data.msg);
					}else{
						alert(data.msg);
					}
					
				}
			});
		});
	}); 
</script>